package com.uroad.lib.widget.dialog;

import android.app.Dialog;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.uroad.lib.R;

public class LoadingDialog extends Dialog {

	
	Context mContext;
	TextView tvMsg;

	public LoadingDialog(Context context, int theme) {
		super(context, theme);
		mContext = context;
	}

	public LoadingDialog(Context context) {
		super(context);
		mContext = context;
	}

	public void initLoading() {
		View view = LayoutInflater.from(mContext).inflate(
				R.layout.dialog_loading, null);
		tvMsg = (TextView) view.findViewById(R.id.tvMsg);
		setCanceledOnTouchOutside(false);
		setContentView(view);
	}

	public void setMsg(String msg){
		if (!TextUtils.isEmpty(msg)) {
			tvMsg.setText(msg);
		}else{
			tvMsg.setText("正在加载...");
		}
	}
}
